//
//  HeaderOfGonglue.m
//  project-A (pianke)
//
//  Created by dllo on 16/2/29.
//  Copyright © 2016年 scott. All rights reserved.
//

#import "HeaderOfGonglue.h"
#import <DKNightVersion.h>

#define WIDTH  [UIScreen mainScreen].bounds.size.width


@implementation HeaderOfGonglue

-(void)dealloc{
    
    [_enname release];
    [_name release];
    [_image release];
    [_view release];
    [super dealloc];
}
-(instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        self.name = [[UILabel alloc]initWithFrame:CGRectMake(80, 15, 100,25)];
        
        self.name.font = [UIFont fontWithName:@"Arial-BoldMT" size:20];
        [self addSubview:self.name];
        
        self.name.dk_textColorPicker = DKColorWithColors([UIColor blackColor], [UIColor colorWithRed:0.64  green:0.74 blue:0.86 alpha:1]);
        
        [self.name release];
        
        self.enname = [[UILabel alloc]initWithFrame:CGRectMake(80, 50, 100, 20)];
               [self addSubview:self.enname];
        self.enname.font = [UIFont fontWithName:@"Arial-BoldMT" size:18];
        
        self.enname.dk_textColorPicker = DKColorWithColors([UIColor blackColor], [UIColor colorWithRed:0.64  green:0.74 blue:0.86 alpha:1]);
        
        [self.enname release];
        
       
        self.image = [[UIImageView alloc]initWithFrame:CGRectMake(20, 20, 40, 40)];
        [self addSubview:self.image];
        
       
        [self.image release];
        
        
        
        self.view = [[UIView alloc]initWithFrame:CGRectMake(15, 0, WIDTH - 30, 1)];
        self.view.backgroundColor = [UIColor lightGrayColor];
        [self addSubview:self.view];
        
        [self.view release];
        
        
    }
    return self;
}


-(void)creatIconwith:(NSString *)number{
   
    if ([number isEqualToString:@"0"]) {
        self.name.text = @"概述";
        self.enname.text = @"Overview";
        self.image.image = [UIImage imageNamed:@"gaishu"];
        
    }else if ([number isEqualToString:@"1"]){
        
        self.name.text = @"出行须知";
        self.enname.text = @"Note";
        self.image.image = [UIImage imageNamed:@"xiebao"];
    }else if ([number isEqualToString:@"2"]){
        
        self.name.text = @"如何到达";
        self.enname.text = @"Arrive";
        self.image.image = [UIImage imageNamed:@"jiangluo"];
    }else if ([number isEqualToString:@"3"]){
        
        self.name.text = @"当地交通";
        self.enname.text = @"Traffic";
        self.image.image = [UIImage imageNamed:@"jiaogong"];
    }else if ([number isEqualToString:@"4"]){
        
        self.name.text = @"景点";
        self.enname.text = @"Attraction";
        self.image.image = [UIImage imageNamed:@"jingdian"];
    }else if ([number isEqualToString:@"5"]){
        
        self.name.text = @"娱乐";
        self.enname.text = @"Entertainment";
        self.image.image = [UIImage imageNamed:@"yule"];
    }else if ([number isEqualToString:@"6"]){
        
        self.name.text = @"住宿";
        self.enname.text = @"Hotel";
        self.image.image = [UIImage imageNamed:@"zhusu"];
    }else if ([number isEqualToString:@"7"]){
        
        self.name.text = @"美食";
        self.enname.text = @"Food";
        self.image.image = [UIImage imageNamed:@"meishi"];
    }else if ([number isEqualToString:@"8"]){
        
        self.name.text = @"购物";
        self.image.image = [UIImage imageNamed:@"gouwu"];
        self.enname.text = @"shopping";
    }else if ([number isEqualToString:@"9"]){
        
        self.name.text = @"离境须知";
        self.enname.text = @"Departure";
        self.image.image = [UIImage imageNamed:@"chujing"];
    }else if ([number isEqualToString:@"11"]){
        
        self.name.text = @"其他";
        self.enname.text = @"Other";
        self.image.image = [UIImage imageNamed:@"shneglv"];
    }
    
   
    
}

@end
